<%@page import="org.lzy.pt.PluginManager"%>
<%@ page import="org.jivesoftware.util.ParamUtils" %>

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>

<%  // Get parameters //
    boolean cancel = request.getParameter("cancel") != null;
    boolean delete = request.getParameter("delete") != null;
    String T_Name = ParamUtils.getParameter(request,"T_Name");
    String T_Ver = ParamUtils.getParameter(request,"T_Ver");

    // Handle a cancel
    if (cancel) {
    	response.sendRedirect("plugin-properties.jsp?T_Name="+T_Name+"&T_Ver="+T_Ver);
        return;
    }
	
    if (delete) {
    	
    	PluginManager.getInstance().deletePlugin(T_Name, Integer.parseInt(T_Ver) );
    	
        response.sendRedirect("plugin-summary.jsp?deletesuccess=true");
        return;
    }
%>

<html>
    <head>
        <title><fmt:message key="plugin.delete.title"/></title>
        <meta name="subPageID" content="plugin-delete"/>
        <meta name="extraParams" content="<%= "T_Name="+T_Name+"&T_Ver="+T_Ver %>"/>
    </head>
    <body>

<p>
<fmt:message key="plugin.delete.info" />
</p>

<form action="plugin-delete.jsp">
<input type="hidden" name="T_Name" value="<%= T_Name %>">
<input type="hidden" name="T_Ver" value="<%= T_Ver %>">
<input type="submit" name="delete" value="<fmt:message key="plugin.delete.delete" />">
<input type="submit" name="cancel" value="<fmt:message key="global.cancel" />">
</form>

    </body>
</html>
